#include "mainwindow.h"
#include "ui_mainwindow.h"

#include "class.h"
#include "student.h"

MainWindow::MainWindow(QWidget *parent)
    : MainWindow("test", parent)

{}

MainWindow::MainWindow(const QString& username, QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWindow) {
    ui->setupUi(this);
    setWindowTitle("学生管理系统 - " + username);

    ui->menubar->addMenu("系统")->addAction("退出登录", this, &QWidget::close);

    ui->statusbar->showMessage("当前用户：" + username);

    ui->tabWidget->addTab(new ClassManager(ui->tabWidget),   "班级管理");
    ui->tabWidget->addTab(new StudentManager(ui->tabWidget), "学生管理");
}

MainWindow::~MainWindow()
{
    delete ui;
}
